/**
* <b>项目名：</b>monitor<br/>
* <b>包名：</b>org.monitor.beans<br/>
* <b>文件名：</b>RequestParam.java<br/>
* <b>版本信息：</b> @version 1.0.0<br/>
* <b>日期：</b>2013-6-22-下午1:42:19<br/>
* <b>Copyright (c)</b> 2013魅族公司-版权所有<br/>
*
*/
	
package org.monitor.beans;

import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;

import com.alibaba.fastjson.JSON;

/**
 * <b>类名称：</b>RequestParam<br/>
 * <b>类描述：</b><pre>

</pre><br/>
 * <b>创建人：</b>张军强<br/>
 * <b>修改人：</b>张军强<br/>
 * <b>修改时间：</b>2013-6-22 下午1:42:19<br/>
 * <b>修改备注：</b><br/>
 * @version 1.0.0<br/>
 */

public class RequestParam {
	
	private String action;
	private HashMap<String, Object> param;
	
	
	
	public String getAction() {
		return action;
	}
	public void setAction(String action) {
		this.action = action;
	}
	public HashMap<String, Object> getParam() {
		return param;
	}
	public void setParam(HashMap<String, Object> param) {
		this.param = param;
	}
	
	public RequestParam() {
		this.param=new HashMap<String, Object>();
	}
	
	public static RequestParam getInstance(){
		return new RequestParam();
	}
	
	
	public List<NameValuePair> getParamsForClent(){
		 List<NameValuePair> params=new ArrayList<NameValuePair>();
		 
		 BasicNameValuePair basepara=new BasicNameValuePair("param",JSON.toJSONString(this.param));
		 params.add(basepara);
		 basepara=new BasicNameValuePair("action",this.action);
		 params.add(basepara);
		 return params;

	}
	
	public String toString(){
		return "param="+ URLEncoder.encode( JSON.toJSONString(this.param)) + "&action="+this.action;
	}

}
